<%@ page language="java" contentType="text/html; charset=UTF-8"
	import="it.polimi.swim.entity.SystemUser,java.util.List"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="myStyle.css">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>My Help Requests</title>
</head>
<body>
<div id='header' >
	<div style="float:left"><a href="homeUser.jsp">SWIMv2</a></div>
	<div style="float:right;"><a href="SignoutServlet">Sign out</a></div>
</div>
<div id="content">
<br>
<fieldset class="fieldsetIndex">
<legend>Select the Helper</legend>
<%
List<SystemUser> usersList = (List<SystemUser>) request.getAttribute("userList");
//int idHelp = Integer.parseInt(request.getParameter("idHelp"));
for(SystemUser u: usersList){
	if((Integer) session.getAttribute("id")!=u.getId()){
		out.print("<form method='post' action='SendHelpServlet'>");
		out.print("- "+u.getName()+ " "+u.getSurname()+"<br>");
		out.println("<input type='hidden' name ='idHelper' value='"+u.getId()+"'>");
		out.println("<input type='hidden' name ='idHelp' value='"+request.getParameter("idHelp")+"'>");
		out.print("<input type='submit' value='send request'>");
		out.print("</form>");
	}
}
%>
</fieldset>
</body>
</html>